package ggcache

import (
	"fmt"
	"hash/crc32"
)

// crc32_ return crc32 value of string
func crc32_(key interface{}) uint32 {

	switch key.(type) {
	case string:
		return crc32.ChecksumIEEE([]byte(key.(string)))
	case []byte:
		return crc32.ChecksumIEEE([]byte(key.(string)))
	default:
		return crc32.ChecksumIEEE([]byte(fmt.Sprintf("%v", key)))
	}
}
